/*
** Lua binding: PapaBall
** Generated automatically by tolua++-1.0.92 on 02/05/12 11:54:37.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_PapaBall_open (lua_State* tolua_S);

#include "test.h"
#include "MenuManager.h"
#include "PapaBallSceneManager.h"

/* function to release collected object via destructor */
#ifdef __cplusplus

static int tolua_collect_test (lua_State* tolua_S)
{
 test* self = (test*) tolua_tousertype(tolua_S,1,0);
	Mtolua_delete(self);
	return 0;
}
#endif


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"test");
 tolua_usertype(tolua_S,"PapaBallSceneManager");
 tolua_usertype(tolua_S,"Scene");
 tolua_usertype(tolua_S,"MenuManager");
}

/* method: new of class  test */
#ifndef TOLUA_DISABLE_tolua_PapaBall_test_new00
static int tolua_PapaBall_test_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"test",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   test* tolua_ret = (test*)  Mtolua_new((test)());
    tolua_pushusertype(tolua_S,(void*)tolua_ret,"test");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  test */
#ifndef TOLUA_DISABLE_tolua_PapaBall_test_new00_local
static int tolua_PapaBall_test_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"test",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   test* tolua_ret = (test*)  Mtolua_new((test)());
    tolua_pushusertype(tolua_S,(void*)tolua_ret,"test");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: printtest of class  test */
#ifndef TOLUA_DISABLE_tolua_PapaBall_test_printtest00
static int tolua_PapaBall_test_printtest00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"test",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  test* self = (test*)  tolua_tousertype(tolua_S,1,0);
  std::string a = ((std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'printtest'", NULL);
#endif
  {
   char* tolua_ret = (char*)  self->printtest(a);
   tolua_pushstring(tolua_S,(const char*)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'printtest'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getSingleton of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_getSingleton00
static int tolua_PapaBall_MenuManager_getSingleton00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   MenuManager& tolua_ret = (MenuManager&)  MenuManager::getSingleton();
    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"MenuManager");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getSingleton'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: ActiveWindow of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_ActiveWindow00
static int tolua_PapaBall_MenuManager_ActiveWindow00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
  std::string name = ((std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ActiveWindow'", NULL);
#endif
  {
   self->ActiveWindow(name);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'ActiveWindow'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Deactive of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_Deactive00
static int tolua_PapaBall_MenuManager_Deactive00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
  bool uninstall = ((bool)  tolua_toboolean(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Deactive'", NULL);
#endif
  {
   self->Deactive(uninstall);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Deactive'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: DeactiveAll of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_DeactiveAll00
static int tolua_PapaBall_MenuManager_DeactiveAll00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeactiveAll'", NULL);
#endif
  {
   self->DeactiveAll();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'DeactiveAll'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: IsMenuActive of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_IsMenuActive00
static int tolua_PapaBall_MenuManager_IsMenuActive00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsMenuActive'", NULL);
#endif
  {
   bool tolua_ret = (bool)  self->IsMenuActive();
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'IsMenuActive'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: LoadUILua of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_LoadUILua00
static int tolua_PapaBall_MenuManager_LoadUILua00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
  std::string name = ((std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'LoadUILua'", NULL);
#endif
  {
   self->LoadUILua(name);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'LoadUILua'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: UnloadCurrentUI of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_UnloadCurrentUI00
static int tolua_PapaBall_MenuManager_UnloadCurrentUI00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'UnloadCurrentUI'", NULL);
#endif
  {
   self->UnloadCurrentUI();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'UnloadCurrentUI'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Initialization of class  MenuManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_MenuManager_Initialization00
static int tolua_PapaBall_MenuManager_Initialization00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"MenuManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  MenuManager* self = (MenuManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Initialization'", NULL);
#endif
  {
   bool tolua_ret = (bool)  self->Initialization();
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Initialization'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getSingleton of class  PapaBallSceneManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_PapaBallSceneManager_getSingleton00
static int tolua_PapaBall_PapaBallSceneManager_getSingleton00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"PapaBallSceneManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   PapaBallSceneManager& tolua_ret = (PapaBallSceneManager&)  PapaBallSceneManager::getSingleton();
    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"PapaBallSceneManager");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getSingleton'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: setScene of class  PapaBallSceneManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_PapaBallSceneManager_setScene00
static int tolua_PapaBall_PapaBallSceneManager_setScene00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PapaBallSceneManager",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PapaBallSceneManager* self = (PapaBallSceneManager*)  tolua_tousertype(tolua_S,1,0);
  std::string name = ((std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setScene'", NULL);
#endif
  {
   self->setScene(name);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'setScene'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: setup of class  PapaBallSceneManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_PapaBallSceneManager_setup00
static int tolua_PapaBall_PapaBallSceneManager_setup00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PapaBallSceneManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PapaBallSceneManager* self = (PapaBallSceneManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setup'", NULL);
#endif
  {
   self->setup();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'setup'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: setupWindow of class  PapaBallSceneManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_PapaBallSceneManager_setupWindow00
static int tolua_PapaBall_PapaBallSceneManager_setupWindow00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PapaBallSceneManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PapaBallSceneManager* self = (PapaBallSceneManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setupWindow'", NULL);
#endif
  {
   self->setupWindow();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'setupWindow'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: getScend of class  PapaBallSceneManager */
#ifndef TOLUA_DISABLE_tolua_PapaBall_PapaBallSceneManager_getScend00
static int tolua_PapaBall_PapaBallSceneManager_getScend00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"PapaBallSceneManager",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  PapaBallSceneManager* self = (PapaBallSceneManager*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getScend'", NULL);
#endif
  {
   Scene* tolua_ret = (Scene*)  self->getScend();
    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Scene");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'getScend'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_PapaBall_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  #ifdef __cplusplus
  tolua_cclass(tolua_S,"test","test","",tolua_collect_test);
  #else
  tolua_cclass(tolua_S,"test","test","",NULL);
  #endif
  tolua_beginmodule(tolua_S,"test");
   tolua_function(tolua_S,"new",tolua_PapaBall_test_new00);
   tolua_function(tolua_S,"new_local",tolua_PapaBall_test_new00_local);
   tolua_function(tolua_S,".call",tolua_PapaBall_test_new00_local);
   tolua_function(tolua_S,"printtest",tolua_PapaBall_test_printtest00);
  tolua_endmodule(tolua_S);
  tolua_cclass(tolua_S,"MenuManager","MenuManager","",NULL);
  tolua_beginmodule(tolua_S,"MenuManager");
   tolua_function(tolua_S,"getSingleton",tolua_PapaBall_MenuManager_getSingleton00);
   tolua_function(tolua_S,"ActiveWindow",tolua_PapaBall_MenuManager_ActiveWindow00);
   tolua_function(tolua_S,"Deactive",tolua_PapaBall_MenuManager_Deactive00);
   tolua_function(tolua_S,"DeactiveAll",tolua_PapaBall_MenuManager_DeactiveAll00);
   tolua_function(tolua_S,"IsMenuActive",tolua_PapaBall_MenuManager_IsMenuActive00);
   tolua_function(tolua_S,"LoadUILua",tolua_PapaBall_MenuManager_LoadUILua00);
   tolua_function(tolua_S,"UnloadCurrentUI",tolua_PapaBall_MenuManager_UnloadCurrentUI00);
   tolua_function(tolua_S,"Initialization",tolua_PapaBall_MenuManager_Initialization00);
  tolua_endmodule(tolua_S);
  tolua_cclass(tolua_S,"PapaBallSceneManager","PapaBallSceneManager","",NULL);
  tolua_beginmodule(tolua_S,"PapaBallSceneManager");
   tolua_function(tolua_S,"getSingleton",tolua_PapaBall_PapaBallSceneManager_getSingleton00);
   tolua_function(tolua_S,"setScene",tolua_PapaBall_PapaBallSceneManager_setScene00);
   tolua_function(tolua_S,"setup",tolua_PapaBall_PapaBallSceneManager_setup00);
   tolua_function(tolua_S,"setupWindow",tolua_PapaBall_PapaBallSceneManager_setupWindow00);
   tolua_function(tolua_S,"getScend",tolua_PapaBall_PapaBallSceneManager_getScend00);
  tolua_endmodule(tolua_S);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_PapaBall (lua_State* tolua_S) {
 return tolua_PapaBall_open(tolua_S);
};
#endif

